Critical properties of the two-dimensional XY model involving solely nematic-like terms of the second and third orders are investigated by spin-wave analysis and Monte Carlo simulation. It is found that, even though neither of the nematic-like terms alone can induce magnetic ordering, their coexistence and competition leads to an extended phase of the magnetic quasi-long-range-order phase, wedged between the two nematic-like phases induced by the respective couplings. Thus, except for the multicritical point, at which all the phases meet, for any finite value of the coupling parameters ratio there are two phase transition: one from the paramagnetic phase to one of the two nematic-like phases followed by another one at lower temperatures to the magnetic phase. The finite-size scaling analysis indicates that the phase transitions between the magnetic and nematic-like phases belong to the Ising and three-state Potts universality classes. Inside the competition-induced algebraic magnetic phase, the spin-pair correlation function is found to decay even much more slowly than in the standard XY model with purely magnetic interactions. Such a magnetic phase is characterized by an extremely low vortex-antivortex pair density attaining a minimum close to the point at which the two couplings are of about equal strength.