Israeli Prime Minister Benjamin Netanyahu has signed a coalition agreement with rival political parties that will allow Israel to form a new government.