Any municipality may contract with its board of supervisors, or any member thereof, whereby said construction, maintenance or repair may be performed by said board or member in which event funds received under this section by such municipality shall first be applied to the payment of said bonds and interest, if any, and the remainder shall be paid over to the county treasury. In the event of such agreement, the contract shall be spread at large upon the minutes of the governing authorities of both such municipality and the board of supervisors of the county.