After more than a year of negotiations, political parties in Bosnia have agreed on the formation of a government.