Uhuru Kenyatta has resigned as Kenya's finance minister after the International Criminal Court ruled he should stand trial for post-election violence.