We study the frequency splitting of nearly degenerate optical modes in weakly deformed microdisks. The analysis is restricted to even-and odd-parity modes in cavities with a mirror-reflection symmetry. The frequency splitting is explained in a semiclassical approach by dynamical tunneling (resonance-assisted tunneling) between clockwise-and counterclockwise-propagating waves. We derive semiclassical predictions for the frequency splittings which are in good agreement with full numerical calculations. Two deformations are studied in detail, the ellipse and the quadrupole, representing a deformation with integrable and nonintegrable ray dynamics. Furthermore, the differences between Dirichlet and dielectric boundary conditions are discussed.