LONDON—The U.K. economy in 2017 grew at the slowest pace in five years, highlighting how Britain isn’t reaping the full benefits of the recent upsurge in global growth as it prepares to leave the European Union.

The U.K. economy expanded 0.5% on the quarter in the final three months of 2017, an annualized rate of 2.0%, the Office for National Statistics said Friday.

That...