The nitrogen chemistry in interstellar clouds