Just because the material doesn't conduct currents on a macroscopic scale, does not mean it doesn't contain any movable charges at all. In fact, as the very name “dielectric” suggests, such a material contains charges which can be to some degree separated – electrons move a bit to one side or the other, never actually bidding their parent atom farewell but still generating a significant field.
When light hits such a material, the electrons are inclined to vibrate in sync with the incomming EM wave. This creates a secondary electromagnetic field of the same frequency, which adds to the original field, much like the larger-scale currents below the surface of a conductor do. Unlike with a conductor, the electrons aren't movable freely so this field can't completely cancel the incoming wave, but it also doesn't pass through completely unimpeded:
- Some of the energy that the secondary wave gives back is directed not in the original propagation direction but backwards: a bit of the light is reflected. (This also happens for conductors, almost perfectly, which is why metals are shiny.)
- The secondary wave isn't completely in sync with the incoming one, but generally has a bit of a phase lag (like when you shake a pendulum). As a result, the wave looks “delayed”, as if it has travelled a longer way through the material than it actually has – from an outside point of view that means the wavelength is shortened despite constant frequency. But because the wavefront still has to be in sync everywhere, you'll get refraction.
Both effects are very notable for clear glass: some of the light is reflected instead of passing through, and the light that is passing through is refracted. Mind, for a glass pane the refraction doesn't do much, it just changes the direction a bit when the light enters and then back again to original when it leaves. But for materials that aren't so homogeneous, like styrofoam, you'll get not just one reflection and refraction but instead have lots and lots of microscopic surfaces, all aligned in different directions. As a result, even if each microsurface lets most of the light past, it doesn't actually manage to get very far into the material but is “reflected” in a completely scattered manner. And that's basically what's happening for all materials which look white. Most of them are still somewhat transparent, but if the components are sufficiently fine and refractive, it won't get further than a few micrometres.
For materials that look coloured or even black, something else happens in addition: the vibrating electrons actually take away some of the energy of the incoming wave and don't re-transmit it at all with that frequency, but instead “convert” to other forms of energy – usually, either lower-frequency light (fluorescence) or charge-neutral lattice vibrations (which manifest as heat). Explaining how this conversion works without quantum mechanics is problematic, but you can basically picture it as a damped vibration – there is “friction” in the oscillation. Often, this only happens to a significant level in a particular frequency band, due to molecular resonances; that's then how colour comes about, because different light-frequencies are damped to different fractions.