Ramayana did not mention any God, as to whom Shri Rama prayed.
——
a) During twilight periods, Shri Rama used to offer water oblations to the Sun and recite the SUPREME mantra.
Ramayana was silent on what the mantra was.
Consider the incident, wherein Sage Vishvamitra (while moving to Siddhashrama) wakes up Shri Rama and Lakshmana, who were sleeping.
कौसल्या सुप्रजा राम पूर्वा संध्या प्रवर्तते | उत्तिष्ठ नरशार्दूल कर्तव्यं दैवमाह्निकम् || १-२३-२
"Fortunate is Kausalya to beget you as her son Rama... get up oh, tigerly-man, eastern aurora is emerging, daytime tasks towards gods are to be performed."
तस्यर्षेः परमोदारं वचः श्रुत्वा नरोत्तमौ | स्नात्वा कृतोदकौ वीरौ जेपतुः परमं जपम् || १-२३-३
On hearing the benign words of the sage those valorous and best ones among men got up, bathed, and on offering water oblation they meditated upon the supreme hymn (mantra).
—-
b) If we strictly go by the opinion of Sage Valmiki, the composer of Ramayana, then there are 2 ideals that Shri Rama adhered to - TRUTH and DHARMA.
When Lakshmana, who fighting with Indrajit, could not kill Indrajit inspite of using all DIVINE weapons that he knew, he used Shri Rama’s ascetic power of adhering to TRUTH and DHARMA. That ascetic power of Shri Rama killed Indrajit.
तदैन्द्रमस्त्रं सौमित्रिः संयुगेष्वपराजितम् |
शरश्रेष्ठं धनुः श्रेष्ठे विकर्षन्निदमिब्रवीत् || ९०-६-७०
लक्ष्मीवान् लक्ष्मणो वाक्यमर्थसाधकमात्मनः |Fitting a missile presided over by Indra the lord of celestials, which had never been defeated in battle, to his excellent bow and drawing it, the glorious Lakshmana addressed the following prayer, which was intended to achieve his purpose:
धर्मात्मा सत्यसन्धश्च रामो दाशरथिर्यदि || ९०-६-७१
पौरुषे चाप्रतिद्वन्द्वस्तदेनं जहि रावणिम् |"O my dear arrow! If Rama the son of Dasaratha has set his mind on virtue, keeps up his promise and is second to none in his prowess, destroy this Indrajit."
इत्युक्त्वा बाणमाकर्णं विकृष्य तमजिह्मगम् || ९०-६-७२
लक्ष्मणः समरे वीरः ससर्जेन्द्रजितं प्रति |Thus saying and drawing up to the ear the arrow, which went straight, the heroic Lakshmana released it towards Indrajit.
तद्राक्षसतनूजस्य छिन्नस्कन्धं शिरो महत् |
तपनीयनिभं भूमौ ददृशे रुधिरोक्षितम् || ९०-६-७५That large head of Indrajit, separated from his trunk and moistened with blood, was seen on the ground, shining like gold.
——
Hence, the god that Shri Rama adored is TRUTH and DHARMA.