British inflation rose more than expected in June and matched one of the highest rates seen over the last year and a half.