According to ancient Egyptian belief the deceased could see through the coffin, they placed eyes in the same position where they would usually sit on the deceased because after they died they eyes would decay so they could no longer tell where they were.
They were basically painted there so that the eyes would be more easily located after the person had died.