The UA2 experiment has collected large samples of W and Z events during recent runs at the CERN pp Collider at s = 630 GeV. These samples have been used to perform precise measurements of the masses of the W and Z bosons. After a careful analysis of systematic errors, an improved result is obtained for the mass ratio mwmz. This provides a new value for the weak mixing parameter sin2θw. Furthermore, it can be combined with recent measurements of the Z mass from e+e- colliders to give an absolute measurement of the W mass, leading to the result mw=80.49±0.43 (stat) ± 0.24 (syst) GeV.