In this Letter we discuss the classical three-dimensional XY model whose nearest-neighbor interaction is a mixture of cos(θi-θj) (ferromagnetic) and cos2(θi-θj) (nematic). This model is dual to a theory with integer and half-integer vortices. While both types of vortices interact with a noncompact U(1) gauge field, the half-integer vortices interact with an extra interaction mediated by a Z2 gauge field. We shall discuss the confinement-deconfinement transition of the half-integer vortices, the Wilson and the 't Hooft loops, and their mutual statistics in path integral language. In addition, we shall present a quantum version of the classical model which exhibits these physics.