Confidence Improves Self-Consistency in LLMs