Cavity-enhanced magnetometer with a spinor Bose–Einstein condensate