State agencies would be prohibited from contracting with businesses that do not provide equal benefits to their employees' same-sex spouses or domestic partners, under a bill narrowly approved by the state Senate.