UNIQA: A Unified Framework for Both Full-Reference and No-Reference Image Quality Assessment