Precision phenomenology at the LHC requires accounting for both higher-order QCD and electroweak corrections as well as for photon-initiated subprocesses. Building upon the recent NNPDF3.1 fit, in this work the photon content of the proton is determined within a global analysis supplemented by the LUXqed constraint relating the photon PDF to lepton-proton scattering structure functions: NNPDF3.1luxQED. The uncertainties on the resulting photon PDF are at the level of a few percent, with photons carrying up to 0.5% of the proton's momentum. We study the phenomenological implications of NNPDF3.1luxQED at the LHC for Drell-Yan, vector boson pair, top quark pair, and Higgs plus vector boson production. We find that photon-initiated contributions can be significant for many processes, leading to corrections of up to 20%. Our results represent a state-of-the-art determination of the partonic structure of the proton including its photon component.