The effect of viscoelasticity on the flow and heat transport in the Rayleigh-Bénard convection (RBC) in a rectangular with horizontal periodic boundary is investigated via direct numerical simulation. The working fluid is described by the finitely extensible nonlinear elastic-Peterlin (FENE-P) constitutive model that is able to capture some of the most important polymeric flow behaviors. Numerical simulations are conducted at a low concentration β = 0.9, where β = μs/μ0, μs is the solvent viscosity, μ0 = μs + μp is sum of μs and the polymer viscosity μp. A parametric analysis is performed to understand the influence of the Weissenberg number Wi, the viscosity ratio β and the extension length L on the oscillating mode of the viscoelastic RBC. It is found that both Wi and β weakly inhibit the convection onset and the transition from steady to oscillatory convection. The amplitude and frequency of the oscillations in the oscillatory flow regime are both suppressed. However, the elastic nonlinearity may make the flow transition irregular and even may bring about the relaminarization or lead to the convection cells traveling in the horizontal direction. The extension length L may induce multiple pairs of roll flow patterns at a specific setting of (Ra, Wi). Heat transport is reduced by elasticity but still obeys the power law with Ra if the flow pattern has one pair of rolls. However, heat transfer enhancement occurs if multiple pairs of rolls are induced.