A model of shadow banking