The variability of quasars. II. Frequency dependence