Quantification of systemic risk from overlapping portfolios in the financial system