Weak magnetic fields have recently been detected in a number of A-type stars, including Vega and Sirius. At the same time, space photometry observations of A- and late B-type stars from Kepler and TESS have highlighted the existence of rotational modulation of surface features akin to stellar spots. Here we explore the possibility that surface magnetic spots might be caused by the presence of small envelope convective layers at or just below the stellar surface, caused by recombination of H and He. Using 1D stellar evolution calculations and assuming an equipartition dynamo, we make simple estimates of field strength at the photosphere. For most models the largest effects are caused by a convective layer driven by second helium ionization. While it is difficult to predict the geometry of the magnetic field, we conclude that the majority of intermediate-mass stars should have dynamo-generated magnetic fields of order a few gauss at the surface. These magnetic fields can appear at the surface as bright spots, and cause photometric variability via rotational modulation, which could also be wide-spread in A-stars. The amplitude of surface magnetic fields and their associated photometric variability is expected to decrease with increasing stellar mass and surface temperature, so that magnetic spots and their observational effects should be much harder to detect in late B-type stars.