Learning modular structures from network data and node variables