Epicurus does indeed believe that gods exist. In fact I have never met anyone with more fear of the things which he said we should not fear, namely death and the gods. He is loud in his claim that the whole of mankind is inwardly scared of things which in reality do not worry normal people overmuch. Thousands on thousands commit robbery with violence in spite of the death penalty, and others plunder every shrine they can lay hands on; those footpads, I suppose, are alarmed by fear of death, and these plunderers by religious panic!
Cicero, The Nature of the Gods, Walsh, tr., Oxford University Press (New York: 2008) p. 33 (sect. 86); the character Cotta is speaking.