A model-based approach to attributed graph clustering