Optima: Optimizing Effectiveness and Efficiency for LLM-Based Multi-Agent System