We present new empirical constraints on the evolution of ρ H2, the cosmological mass density of molecular hydrogen, back to z ≈ 2.5. We employ a statistical approach measuring the average observed 850 μm flux density of near-infrared selected galaxies as a function of redshift. The redshift range considered corresponds to a span where the 850 μm band probes the Rayleigh-Jeans tail of thermal dust emission in the rest frame, and can therefore be used as an estimate of the mass of the interstellar medium. Our sample comprises of ≈150,000 galaxies in the UK InfraRed Telescope Infrared Deep Sky Survey Ultra-Deep Survey field with near-infrared magnitudes K AB ≤ 25 mag and photometric redshifts with corresponding probability distribution functions derived from deep 12-band photometry. With a sample approximately 2 orders of magnitude larger than in previous works we significantly reduce statistical uncertainties on ρ H2 to z ≈ 2.5. Our measurements are in broad agreement with recent direct estimates from blank field molecular gas surveys, finding that the epoch of molecular gas coincides with the peak epoch of star formation with ρ H2, 2×107,MȮ Mpc-3at z ≈ 2. We demonstrate that rho; H2, can be broadly modeled by inverting the star formation rate (SFR) density with a fixed or weakly evolving star formation efficiency. This "constant efficiency"model shows a similar evolution to our statistically derived ρ H2,, indicating that the dominant factor driving the peak star formation history at z ≈ 2 is a larger supply of molecular gas in galaxies rather than a significant evolution of the SFR efficiency within individual galaxies.