Dispersive readout of a flux qubit at the single-photon level