The board of supervisors of any county may contract with any local agency within the county, and the legislative body of the local agency may contract with the county, for the performance by the county firewarden of functions for the prevention and suppression of fires.