Methanol masers reveal the magnetic field of the high-mass protostar IRAS 18089-1732