In the classical vehicle routing problem with backhauls (VRPB) the customers are divided into two sets; the linehaul and backhaul customers, so that the distribution and collection services of goods are separated into different routes. This is justified by the need to avoid the reorganization of the loads inside the vehicles, to reduce the return of the vehicles with empty load and to give greater priority to the customers of the linehaul. Many logistics companies have special responsibility to make their operations greener, and electric vehicles (EVs) can be an efficient solution. Thus, when the fleet consists of electric vehicles (EVs), the driving range is limited due to their battery capacities and, therefore, it is necessary to visit recharging stations along their route. In this paper the electric vehicle routing problem with backhauls (EVRPB) is introduced and formulated as a mixed integer linear programming model. This formulation is based on the generalization of the open vehicle routing problem considering a set of new constraints focussed on maintaining the arborescence condition of the linehaul and backhaul paths. Different charging points for the EVs are considered in order to recharge the battery at the end of the linehaul route or during the course of the backhaul route. Finally, a heuristic initialization methodology is proposed, in which an auxiliary graph is used for the efficient coding of feasible solutions to the problem. The operation and effectiveness of the proposed formulation is tested on two VRPB instance datasets of literature which have been adapted to the EVRPB.