By Jon Sindreu and Jason Douglas 

LONDON--The British economy grew at a faster pace than previously thought in 2014, official data revealed Tuesday, confirming that the U.K. was the top performing major western nation during the year.

Gross domestic product expanded 2.8% in 2014, the Office for National Statistics said, compared with an earlier estimate of 2.6%. The upward revision was due to stronger-than-expected household spending and a rise in exports during the final quarter of the year.

This rosier picture of Britain's economic health comes as an unexpected boon for the government ahead of a general election in May, as the median forecast by analysts was the ONS would leave GDP growth rates unchanged. Recent polls show Prime Minister David Cameron and his Conservative Party--currently in a coalition with the Liberal Democrats--are neck-in-neck with the main opposition Labour Party, but also underscores that Britons' view their economic management under an increasingly positive light.

Britain finished 2014 as the fastest-growing nation within the Group of Seven western countries.

However, growth figures are less flattering when measured in a per head basis. GDP per person rose 2.2% in 2014, the ONS said. This means the fast recovery in 2014 was in part thanks to a growing population that added to the country's output, since the economy remains 1.2% smaller per head than it was when the recession started in early 2008.

Nonetheless, analysts believe Britain will have a bumper 2015, as fatter paychecks and subdued prices due to cheaper oil in the international markets drive households to buy more.

Research firm GfK Group said Tuesday that consumer confidence in the U.K. was at its highest level in almost 13 years in March, having risen steadily since the start of 2015. Respondents to the monthly survey were increasingly upbeat about both the prospects of the economy and their personal finances, which is "likely to be good news for the government" in the run-up to the election, said Nick Moon, GfK managing director of social research.

Official figures show living standards, another of the main battlegrounds in the general election campaign, have improved only modestly after a five-year-long squeeze. Real household disposable income, which measures how much families have to spend or save accounting for the impact of inflation, rose only 0.1% a head in 2014, despite signs the recovery started to be felt in people's pockets in the final quarter.

Write to Jon Sindreu at jon.sindreu@wsj.com and Jason Douglas at jason.douglas@wsj.com