Quasiparticle tunneling across a Josephson junction sets a limit for the lifetime of a superconducting qubit state. We develop a general theory of the corresponding decay rate in a qubit controlled by a magnetic flux. The flux affects quasiparticles tunneling amplitudes, thus making the decay rate flux-dependent. The theory is applicable for an arbitrary quasiparticle distribution. It provides estimates for the rates in practically important quantum circuits and also offers a new way of measuring the phase-dependent admittance of a Josephson junction.