Chris Huhne has resigned from his post as the energy secretary following being charged with perverting the course of justice.