Synthesis of refractory organic matter in the ionized gas phase of the solar nebula