Unifying description of competing orders in two-dimensional quantum magnets