Optical properties of interstellar graphite and silicate grains