Angular correlations in B+ -> X(3872)K+ decays, with X(3872) -> rho(0)J/psi, rho(0) -> pi(+)pi(-) and J/psi -> pi(+)pi(-), are used to measure orbital angular momentum contributions and to determine the J(PC) value of the X(3872) meson. The data correspond to an integrated luminosity of 3.0 fb(-1) of proton- proton collisions collected with the LHCb detector. This determination, for the first time performed without assuming a value for the orbital angular momentum, confirms the quantum numbers to be J(PC) = 1(++). The X(3872) is found to decay predominantly through an S wave and an upper limit of 4% at 95% C.L. is set on the D-wave contribution.