We determine the Milky Way (MW) mass profile inferred from fitting physically motivated models to the Gaia DR2 Galactic rotation curve and other data. Using various hydrodynamical simulations of MW-mass haloes, we show that the presence of baryons induces a contraction of the dark matter (DM) distribution in the inner regions, r 20 kpc. We provide an analytic expression that relates the baryonic distribution to the change in the DM halo profile. For our galaxy, the contraction increases the enclosed DM halo mass by factors of roughly 1.3, 2 and 4 at radial distances of 20, 8 and 1 kpc, respectively compared to an uncontracted halo. Ignoring this contraction results in systematic biases in the inferred halo mass and concentration. We provide a best-fitting contracted NFW halo model to the MW rotation curve that matches the data very well. The best-fit has a DM halo mass, M DM 200 = 0.99 +0.18 −0.20 ×10 12 M , and concentration before baryon contraction of 8.2 +1.7 −1.5 , which lie close to the median halo mass-concentration relation predicted in ΛCDM. The inferred total mass, M total 200 = 1.12 +0.20 −0.22 × 10 12 M , is in good agreement with recent measurements. The model gives a MW stellar mass of 4.99 +0.34 −0.50 × 10 10 M , of which 60% is contained in the thin stellar disc, with a bulge-to-total ratio of 0.2. We infer that the DM density at the Solar position is ρ DM = 9.0 +0.5 −0.4 × 10 −3 M pc −3 ≡ 0.34 +0.02 −0.02 GeV cm −3 . The rotation curve data can also be fitted with an uncontracted NFW halo model, but with very different DM and stellar parameters. The observations prefer the physically motivated contracted NFW halo, but the measurement uncertainties are too large to rule out the uncontracted NFW halo.