Gas and electricity prices will rise by 4% from October under the new cap from Ofgem.