Real-time traffic prediction is crucial for the optimization and control of connected and autonomous vehicles (CAVs) to save energy. The energy optimization for CAVs typically decides control actions for a forward-looking time horizon. To ensure a safe operation and comply with traffic rules, it is necessary to predict future traffic conditions and consider these 'constraints' during the energy optimization. For example, the knowledge of preceding vehicles' future trajectory determines the bounds of car-following distance for the target vehicle. A key challenge of traffic prediction is how to handle mixed traffic scenarios where both CAVs and non-CAVs co-exist. In this work, a traffic prediction framework is developed based on the traffic flow model to improve the energy efficiency of CAVs in mixed traffic scenarios. Information from connected vehicles (CVs) provides partial measurement of traffic states (traffic speed and density). The unknown traffic states are estimated using a state observer. Once the full traffic states are known, future traffic states are predicted by propagating the traffic flow model forward in time. With on-board perception sensors, CVs can detect the location and speed of adjacent vehicles. This information is used as additional measurement for the traffic state observer. The proposed traffic prediction framework has been studied comprehensively for various penetration rates of connectivity and locations of CVs for a signalized roadway. Simulation results have shown that with additional information from perception sensors, traffic prediction error is reduced by 25%.