Dephasing of qubits by the Schrödinger cat