Electron spin resonance detected by a superconducting qubit