A model for the dynamics of face-to-face interactions in social groups