Magnetic moment of a three-dimensional quantum well in a quantizing magnetic field