A local board of education may enter into a written agreement with (1) the board of finance in each town or city having a board of finance, (2) the board of selectmen in each town having no board of finance, or (3) otherwise to the authority making appropriations for the school district, to authorize such board of finance, board of selectmen or such other authority making appropriations to take responsibility for the provision of any noneducational services being provided by such board of education.