Effective action of dilaton gravity as the classical double copy of Yang-Mills theory