Jean-Bernard Lévy of EDF will leave before his term ends, the company said.