Opinion formation and disease spreading are among the most studied dynamical processes on complex networks. In real societies, it is expected that these two processes depend on and affect each other. However, little is known about the effects of opinion dynamics over disease dynamics and vice versa, since most studies treat them separately. In this work we study the dynamics of the voter model for opinion formation intertwined with that of the contact process for disease spreading, in a population of agents that interact via two types of connections, social and contact. These two interacting dynamics take place on two layers of networks, coupled through a fraction of links present in both networks. The probability that an agent updates its state depends on both the opinion and disease states of the interacting partner. We find that the opinion dynamics has striking consequences on the statistical properties of disease spreading. The most important is that the smooth (continuous) transition from a healthy to an endemic phase observed in the contact process, as the infection probability increases beyond a threshold, becomes abrupt (discontinuous) in the two-layer system. Therefore, disregarding the effects of social dynamics on epidemics propagation may lead to a misestimation of the real magnitude of the spreading. Also, an endemic-healthy discontinuous transition is found when the coupling overcomes a threshold value. Furthermore, we show that the disease dynamics delays the opinion consensus, leading to a consensus time that varies nonmonotonically with in a large range of the model's parameters. A mean-field approach reveals that the coupled dynamics of opinions and disease can be approximately described by the dynamics of the voter model decoupled from that of the contact process, with effective probabilities of opinion and disease transmission.