Frequency conversion in ultrastrong cavity QED