Two ageing UK nuclear power stations will remain operational until 2028, Centrica and EDF have announced.