Mechanical detection of magnetic resonance