The board of supervisors of each county is authorized to make contract with any village or small town within the county to work its convicts on the county farm. But in agreeing to take and work such convicts the board of supervisors shall not agree to pay more per day for the labor of any municipal convict than in its judgment the labor of such convict is worth to the county, in order that in the working of such municipal convicts the county shall not do so at a loss to the county.