UK economic growth slowed as US President Donald Trump's tariffs hit and businesses grappled with higher costs, official figures show.