Google has illegally exploited its dominance in the search engine market to stifle competition, a judge in the US has ruled.