Credit risk contagion and systemic risk on networks