Electrochemical production of hydrocarbons from carbon dioxide and water