We observe a seemingly complex magnetic field dependence of dielectric constant of hexagonal YbMnO3 near the spin ordering temperature. After rescaling, the data taken at different temperatures and magnetic fields collapse on a single curve describing the sharp anomaly in nonlinear magnetoelectric response at the magnetic transition. We show that this anomaly is a result of the competition between two magnetic phases. The scaling and the shape of the anomaly are explained using the phenomenological Landau description of the competing phases in hexagonal manganites.