Supersonic beams of polar molecules are deflected using inhomogeneous electric fields. The quantum-state selectivity of the deflection is used to spatially separate molecules according to their quantum state. A detailed analysis of the deflection and the obtained quantum-state selection is presented. The rotational temperatures of the molecular beams are determined from the spatial beam profiles and are all approximately 1 K. Unprecedented degrees of laser-induced alignment (<cos2 theta2D>=0.972) and orientation of iodobenzene molecules are demonstrated when the state-selected samples are used. Such state-selected and oriented molecules provide unique possibilities for many novel experiments in chemistry and physics.