Spontaneous breaking of time-reversal symmetry in the pseudogap state of a high-Tc superconductor