Bosnian political parties agree to form government