British Gas has agreed to pay a £20million penalty to settle an investigation into the forced fitting of prepayment meters.