Establishing the phase diagram of hydrogen is a major challenge for experimental and theoretical physics. Experiment alone cannot establish the atomic structure of solid hydrogen at high pressure, because hydrogen scatters X-rays only weakly. Instead our understanding of the atomic structure is largely based on density functional theory (DFT). By comparing Raman spectra for low-energy structures found in DFT searches with experimental spectra, candidate atomic structures have been identified for each experimentally observed phase. Unfortunately, DFT predicts a metallic structure to be energetically favoured at a broad range of pressures up to 400 GPa, where it is known experimentally that hydrogen is nonmetallic. Here we show that more advanced theoretical methods (diffusion quantum Monte Carlo calculations) find the metallic structure to be uncompetitive, and predict a phase diagram in reasonable agreement with experiment. This greatly strengthens the claim that the candidate atomic structures accurately model the experimentally observed phases.