We consider a Banach algebra $A$ with the property that, roughly speaking, sufficiently many irreducible representations of $A$ on nontrivial Banach spaces do not vanish on all square zero elements. The class of Banach algebras with this property turns out to be quite large -- it includes $C^*$-algebras, group algebras on arbitrary locally compact groups, commutative algebras, $L(X)$ for any Banach space $X$, and various other examples. Our main result states that every derivation of $A$ that preserves the set of quasinilpotent elements has its range in the radical of $A$.