VO2: Orbital competition, magnetism, and phase stability