We present the magnetic and superconducting phase diagram of EuFe$_2$As$_2$ for $B parallel c$ and $B parallel ab$. The antiferromagnetic phase of the Eu$^{2+}$ moments is completely enclosed in the superconducting phase. The upper critical field vs. temperature curves exhibit strong concave curvatures, which can be explained by the Jaccarino-Peter compensation effect due to the antiferromagnetic exchange interaction between the Eu$^{2+}$ moments and conduction electrons.