Evidence for an electron nematic phase transition in underdoped iron pnictide superconductors