We study thermal emission from circumstellar structures heated by gamma-ray burst (GRB) radiation and ejecta and calculate its contribution to GRB optical and X-ray afterglows using the modified radiation hydro-code small STELLA. It is shown that thermal emission originating in heated dense shells around the GRB progenitor star can reproduce X-ray plateaus (like observed in GRB 050904, 070110) as well as deviations from a power law fading observed in optical afterglows of some GRBs (e.g. 020124, 030328, 030429X, 050904). Thermal radiation pressure in the heated circumburst shell dominates the gas pressure, producing rapid expansion of matter similar to supenova-like explosions close to opacity or radiation flux density jumps in the circumburst medium. This phenomenon can be responsible for so-called supernova bumps in optical afterglows of several GRBs. Such a `quasi-supernova suggests interpretation of the GRB-SN connection which does not directly involve the explosion of the GRB progenitor star.