  We calculate exclusive production of a longitudinally polarized heavy vector
meson at next-to-leading order in the dipole picture. The large quark mass
allows us to separately include both the first QCD correction proportional to
the coupling constant $\alpha_s$, and the first relativistic correction
suppressed by the quark velocity $v^2$. Both of these corrections are found to
be numerically important in $\mathrm{J}/\psi$ production. The results obtained
are directly suitable for phenomenological calculations. We also demonstrate
how vector meson production provides complementary information to structure
function analyses when one extracts the initial condition for the energy
evolution of the proton small-$x$ structure.
