Magnetic switch with no moving parts
Yes. Search for 'hall effect' switches.



Figure 1. Hall-effect sensor.


  The Hall effect is the production of a voltage difference (the Hall
  voltage) across an electrical conductor, transverse to an electric
  current in the conductor and a magnetic field perpendicular to the
  current. It was discovered by Edwin Hall in 1879.


Hall effect on Wikipedia.



Figure 2. Hall sensor available from Sparkfun for &lt; $1.

Analog sensors are available with built-in electronics to amplify the small signal generated by the hall-effect to a more useful level, typically 0 to 5 V or 0 to 10 V. The output voltage will then be a function of the magnetic field strength - typically determined by the proximity of the magnet.

Digital sensors are available with built-in electronics to amplify the hall-effect signal and turn on a digital output when the level exceeds a specified magnetic field strength. Usually a little hysteresis is employed so the field strength has to fall a bit before the switch turns off. This prevents rapid switching when the field strength is just on the threshold.

The Sparkfun device listed above has an 'open-collector' output to interface to your micro. This will require a pull-up resistor. Ask if you need help with this.

Read OP and @davidcary's comments below on latching types. I was not aware of these and hadn't read the details on the Sparkfun device I linked to. I learn too!