Additional info from Skeptical Science
Volcanoes emit sulfate aerosols which reflect incoming sunlight, cooling the planet. A large volcanic eruption such as the Pinatubo eruption in 1991 can have a global cooling effect of 0.1° to 0.3°C for several years. However, mega-eruptions or a series of eruptions can have a cooling effect that take decades to wear off, giving a perceived warming effect.
A lack of volcanic activity had some part in temperature rise over the first half of the 20th century. However, it has played little part in the modern global warming trend that began in the 1970s. Foster and Rahmstorf (2011) used a multiple linear regression approach to filter out the effects of volcanic and solar activity and the El Niño Southern Oscillation (ENSO). They found that volcanic activity, as measured by aerosol optical thickness data (AOD), has only caused between 0.02 and 0.04°C of warming per decade from 1979 through 2010, or about 0.06 to 0.12°C warming of the surface and lower troposphere, respectively, since 1979 (out of approximately 0.5°C observed surface warming).
Like Foster and Rahmstorf, Lean and Rind (2008) performed a multiple linear regression on the temperature data, and found that although volcanic activity can account for about 10% of the observed global warming from 1979 to 2005, between 1889 and 2006 volcanic activity had a small net cooling effect on global temperatures. Thus volcanoes have not caused the long-term global warming over the past century, and can explain only a small fraction of the warming over the past 25 years.
Adapted by © John Cook and Skeptical Science