Photoelectric heating of the interstellar gas