Cooperative convex control of multiagent systems