BeautifulPrompt: Towards Automatic Prompt Engineering for Text-to-Image Synthesis