The UK economy recorded its weakest year-on-year growth since 2013 in the three months to the end of June, and the major services sector contracted in July.

The data showed a possible loss of momentum as the Bank of England prepares to raise interest rates for the first time in a decade. 

Official UK data showed year-on-year gross domestic product growth slowed to 1.5% in the second quarter from 1.8% in the first three months of the year. 

This confounded economists' expectations in a Reuters poll for it to be unchanged from an earlier 1.7% estimate. 

The quarterly growth rate was unrevised at 0.3%, the Office for National Statistics said. 

However, there was more positive news in the composition of growth in the second quarter, which showed bigger contributions from business investment and exports than previously thought. 

"There was a notable slowdown in growth in the first half of 2017. The often buoyant services sector was the only area to grow in the second quarter," ONS statistician Darren Morgan said. 

But July figures for the services sector, which makes up 80% of the UK economy, showed a 0.2% decline on the month after growth of 0.3% in June.  

After faster than expected growth in 2016, Britain's economy has underperformed its peers so far this year as the effect of a weaker currency since last year's Brexit vote catches up with consumers. 

Today's data confirms that growth in the first half of 2017 was the slowest for the first half of any year since 2012. 

The UK's current account deficit, was 4.6% in the second quarter, up from 4.4% in the first quarter. 

In cash terms, the deficit was £23.182 billion compared with economists' forecasts of £16 billion, after a big upward revision to the first-quarter deficit. 

UK consumer confidence figures from market research company GfK, released overnight, showed morale inched up in September, despite rising pessimism about household finances.

But house price data for Nationwide showed the slowest growth in over four years. 

The Bank of England has said it expects to raise interest rates in the coming months to tackle rising consumer price inflation, which it expects will exceed 3% in October. 

Most economists expect a rate rise will come after the Bank of England's next rates decision meeting on November 2. 

Bank of England Governor Mark Carney said in a radio interview earlier today that policymakers had given about as clear a signal on rates as possible, and that the economy was on track for rates to rise in the relatively near future.