Municipalities and counties are empowered severally and jointly to enter into the contracts provided for in §68-11-501. The municipalities and counties and those persons maintaining hospitals are authorized mutually to agree as to the amount of the expenses of the operation and upkeep of the hospital to be paid by the municipality and the county, and to apportion the expenses of operation and upkeep between the municipality and the county, the agreement to be made by the legislative bodies of the municipality and the county.