Elemental nitrogen partitioning in dense interstellar clouds