We present a neutron-scattering study of the static and dynamic spin correlations in the underdoped high-temperature superconductor YBa2Cu3O6.45 in magnetic fields up to 15 T. The field strongly enhances static incommensurate magnetic order at low temperatures and induces a spectral-weight shift in the magnetic-excitation spectrum. A reconstruction of the Fermi surface driven by the field-enhanced magnetic superstructure may thus be responsible for the unusual Fermi surface topology revealed by recent quantum-oscillation experiments.