Optimization-based Prompt Injection Attack to LLM-as-a-Judge