To explore the formation of noncollinear magnetic configurations in materials with strongly correlated electrons, we derive a noncollinear $\mathrm{LSDA}+U$ model involving only one parameter $U$, as opposed to the difference between the Hubbard and Stoner parameters $U\ensuremath{-}J$. Computing $U$ in the constrained random phase approximation, we investigate noncollinear magnetism of uranium dioxide ${\mathrm{UO}}_{2}$ and find that the spin-orbit coupling (SOC) stabilizes the $3\mathbf{k}$ ordered magnetic ground state. The estimated SOC strength in ${\mathrm{UO}}_{2}$ is as large as 0.73 eV per uranium atom, making spin and orbital degrees of freedom virtually inseparable. Using a multipolar pseudospin Hamiltonian, we show how octupolar and dipole-dipole exchange coupling help establish the $3\mathbf{k}$ magnetic ground state with canted ordering of uranium $f$ orbitals. The cooperative Jahn-Teller effect does not appear to play a significant part in stabilizing the noncollinear $3\mathbf{k}$ state, which has the lowest energy even in an undistorted lattice. The choice of parameter $U$ in the $\mathrm{LSDA}+U$ model has a notable quantitative effect on the predicted properties of ${\mathrm{UO}}_{2}$, in particular on the magnetic exchange interaction and, perhaps trivially, on the band gap: The value of $U=3.46\phantom{\rule{0.16em}{0ex}}\mathrm{eV}$ computed fully ab initio delivers the band gap of 2.11 eV in good agreement with experiment, and a balanced account of other pertinent energy scales.