A dynamic network model with persistent links and node-specific latent variables, with an application to the interbank market