Energetics and electronic structure of graphene nanoribbons under a lateral electric field