Two or more counties, or other governmental units, by action of their legislative bodies, may join in establishing and maintaining a regional library under the terms of a contract to which all will agree. The expenses of the regional library shall be apportioned between or among the contracting parties concerned on such basis as shall be agreed upon in the contract. The treasurer of one of the governmental units, as shall be provided in the contract, shall have the custody of the funds of the regional library; and the treasurers of the other governmental units concerned shall transfer quarterly to him or her all moneys collected for free public library purposes in their respective governmental units. If the legislative body of any governmental unit decides to withdraw from a regional library contract, the governmental unit withdrawing shall be entitled to a division of the property on the basis of its contributions.