Would proximity to water affect a magnetometer
No. Magnetic fields and water interaction are not your issues.  Water and electronics we know don't mix, but your objective is to place the sensor as close to the center of the boat.  Human sized boats frequently install fluxgate compasses below the waterline, but you want to avoid large ferrous masses like the engine, stove etc.

There is a nice diagram in this owners manual. (No endorsement its just the first one that came up with a decent picture)
http://www.raymarine.com/WorkArea/DownloadAsset.aspx?id=1841 

Fair winds