AIMS: Search for star formation regions in the hosts of potentially young radio galaxies (Gigahertz Peaked Spectrum and Compact Steep Spectrum sources). METHODS: Near-UV imaging with the Hubble Space Telescope Advanced Camera for Surveys.} RESULTS: We find near-UV light which could be the product of recent star formation in eight of the nine observed sources, though other explanations are not currently ruled out. The UV luminosities of the GPS and CSS sources are similar to those of a sample of nearby large scale radio galaxies. Stellar population synthesis models are consistent with a burst of recent star formation occuring before the formation of the radio source. However, observations at other wavelengths and colors are needed to definitively establish the nature of the observed UV light. In the CSS sources 1443+77 and 1814-637 the near-UV light is aligned with and is co-spatial with the radio source. We suggest that in these sources the UV light is produced by star formation triggered and/or enhanced by the radio source.