The mass and width of the W boson are determined in e+e− collisions at LEP using 183 pb−1 of data recorded at a centre-of-mass energy √s = 189 GeV with the OPAL detector. The invariant mass distributions from 970 W+W−→qqqq and 1118 W+W−→qqℓνℓ candidate events are used to measure the mass of the W boson, MW=80.451±0.076 (stat.)±0.049 (syst.) GeV. A direct measurement of the width of the W boson gives ΓW=2.09±0.18 (stat.)±0.09 (syst.) GeV. The results are combined with previous OPAL results from 78 pb−1 of data recorded with √s from 161 to 183 GeV, to obtain: MW=80.432±0.066 (stat.)±0.045 (syst.) GeV, ΓW=2.04±0.16 (stat.)±0.09 (syst.) GeV. The consistency of the direct measurement of MW with that inferred from other measurements of electroweak parameters provides an important test of the Standard Model of electroweak interactions.