Modelling systemic risk in financial markets