Unified Text-to-Image Generation and Retrieval