The library board of any public library may contract with the city council of any city, with the trustees of any incorporated village, with the county board of the county in which such library is located or of any adjacent county, or with the directors of any school district, to furnish the use and privilege of its library to the inhabitants of such city, village, county, township or school district, to the extent and upon such terms as may be agreed upon.