Electronic and magnetic properties of single-layer graphene doped by nitrogen atoms