The Gaia-ESO Survey: Tracing interstellar extinction