We study minimization of a structured objective function, being the sum of a smooth function and a composition of a weakly convex function with a linear operator. Applications include image reconstruction problems with regularizers that introduce less bias than the standard convex regularizers. We develop a variable smoothing algorithm, based on the Moreau envelope with a decreasing sequence of smoothing parameters, and prove a complexity of {mathcal {O}}(epsilon ^{-3}) to achieve an epsilon -approximate solution. This bound interpolates between the {mathcal {O}}(epsilon ^{-2}) bound for the smooth case and the {mathcal {O}}(epsilon ^{-4}) bound for the subgradient method. Our complexity bound is in line with other works that deal with structured nonsmoothness of weakly convex functions.