Correlation and Contagion as Sources of Systemic Risk