(CNN) Kenya's Supreme Court has ordered a rerun of the country's contentious presidential election, after a legal challenge by the opposition.