Measurement of the neutrino mixing angle $\theta_23$ in NOvA