A criterion for stability of cluster synchronization in networks with external equitable partitions