Use of a magnetoresistor to measure the magnetic field in a superconducting magnet