Synthesis and degradation of nucleic acid components by formamide and cosmic dust analogues