Line of second-order phase transitions in the four-dimensional Z2 gauge theory with matter fields