The Veda was available only 3 parts, ie., Rig, Sama and Yajur at the time of composition of Ramayana by Sage Valmiki. That was why Sage Valmiki mentioned it so.
A mention as made in the 2nd sloka of 15th Sarga of Bala Kanda about atharvashIrsha - अथर्वशिरसि.
इष्टिं तेऽहं करिष्यामि पुत्रीयां पुत्रकारणात् | अथर्वशिरसि
प्रोक्तैर्मन्त्रैः सिद्धां विधानतः || १-१५-२
"I will procedurally conduct the ritual contained in the preamble of
atharva-veda with procedural hymns, called <>putra kaameSTi i.e.,
the ritual that bestows sons, for your benefit."
However, as this sloka was mentioned as a preamble to putrakAmeshthi yagna, which is an interpolated story in Ramayana, this sloka is also an interpolated one.
Thus, by the time Ramayana was composed, there were only 3 Vedas.
If we go through the Manu Smriti, we can find that it mentions about 3 Vedas only.
षट् त्रिंशदाब्दिकं चर्यं गुरौ त्रैवेदिकं व्रतम् । तदर्धिकं पादिकं वा
ग्रहणान्तिकमेव वा ॥ १ ॥
ṣaṭ triṃśadābdikaṃ caryaṃ gurau traivedikaṃ vratam | tadardhikaṃ
pādikaṃ vā grahaṇāntikameva vā || 1 ||
Duties relating to the Three Vedas should be observed under the
Preceptor for thirty-six years, or for half that period, or for a
quarter, or precisely till they have been got up.
Let us consider what text from other way of faith Buddhism say about the number of Vedas.
The Sutta Nipāta 1026 (P.303) mentions about 3 vedas only.
His age is a hundred and twenty years, by clan he is a Bāvarī, upon
his body appear three signs, Three Vedas he has mastered all.
We should remember that that Gautama, the Buddha took birth in a Hindu family only. He studied the prevalent literature , observed the prevalent customs and practices , got vexed with the degraded form of spiritual aspects in his times, adopted his own method and finally reached the stage SAT, which Veda described in RV 1.164.46.
Bhagavad Gita is a part of Mahabharata. While explaining the various aspects, Sri Krishna says in the "Rajavidya Rajaguhya Yoga" as follows:
पिताऽहमस्य जगतो माता धाता पितामहः। वेद्यं पवित्रमोंकार ऋक् साम
यजुरेव च।।9.17।।
I am both the father and the mother of the universe, I am the
Maintainer, the Grandsire, the object of all knowledge, the purifier,
the syllable oµ and I am the Rig Veda, Såma Veda and the Yajur
Veda.
Srimad Bhagavad Gita was narrated to Arjuna by Sri Krishna, almost at the end of Dwapar Yuga. Even at time also, the vedas were 3 parts only, but not 4.
The Atharvana Veda is missing.
Now, coming to the question part - Who divided the Vedas?, we have to take a holistic look to understand the issue.
The Rig Veda, composed by various sages at different times, was/is/will be the source of Dharma, for attaining SPIRITUAL heights, for talking anything about Sanatana Dharma.
Sama is Rasa or essence of Rig-Veda i.e. That is most essential part.
The Yagnas mentioned in Rig Veda are mostly mind related, but misunderstood by many and interpreted them to be physical. That is why the Yajur Veda contains physical yagnas.
Even in Ramayana, we can find the importance of Yajur Veda. Sri Rama was described as यजुः वेद विनीतः - trained in Yajurveda.
यजुः वेद विनीतः च वेदविद्भिः सुपूजितः | धनुः वेदे च वेदे च वेद अन्गेषु
च निष्ठितः || ५-३५-१४
"He got trained in Yajurveda, the sacrificial Veda. He is highly
honoured by those well-versed in Vedas. He is skilled in Dhanurveda,
the science of archery, other Vedas and the six limbs* of Vedangas."
No body divided Vedas into parts. The Sama and Yajur vedas evolved from Rig Veda.
Sama Veda
The Sama Veda, divided into two major parts, first to include the four
melody collections, or the Saman, the songs and the latter the Arcika,
or the verse books a collection (Samhita) of hymns, portions of hymns,
and detached verses. A liturgical text, relating to public worship,
all but 75 verses of the total 1875 is derived from the Rig Veda.
Yajur Veda:
The earliest and most ancient layer of Yajur Veda, Samhita includes
about 1,875 verses, that are distinct yet borrowed from and built upon
the foundation of verses in Rigveda.
The middle layer includes the
Satapatha Brahmana, one of the largest Brahmana texts in the Vedic
collection and The youngest layer of Yajur Veda text includes the
largest collection of primary Upanishads six in number, influential to
various schools of Hindu philosophy. These include the Brihadaranyaka
Upanishad, the Isha Upanishad, the Taittiriya Upanishad, just to name
a few.
For example: The Purusha Suktam appears both in Rig Veda and Shukla Yajurveda
Now the question of attributing the division of the Vedas to Sage Vyasa crops up.
This was attributed by subsequent writers to Sage Vyasa, narrating him to be an incarnation of Vishnu. Attributing authorship of Puranas might have been done by subsequent writers, in order to give authority to Puranas on par with the Vedas.