Massive black holes generated by cosmic strings