We present the luminosity function of z ∼ 4 quasars based on the Hyper Suprime-Cam Subaru Strategic Program Wide layer imaging data in the g, r, i, z, and y bands covering 339.8 deg2. From stellar objects, 1666 z ∼ 4 quasar candidates are selected via the g-dropout selection down to i = 24.0mag. Their photometric redshifts cover the redshift range between 3.6 and 4.3, with an average of 3.9. In combination with the quasar sample from the Sloan Digital Sky Survey in the same redshift range, a quasar luminosity function covering the wide luminosity range of M1450 = -22 to -29mag is constructed. The quasar luminosity function is well described by a double power-law model with a knee at M1450 = -25.36±0.13mag and a flat faint-end slope with a power-law index of -1.30±0.05. The knee and faint-end slope show no clear evidence of redshift evolution from those seen at z ∼ 2. The flat slope implies that the UV luminosity density of the quasar population is dominated by the quasars around the knee, and does not support the steeper faint-end slope at higher redshifts reported at z > 5. If we convert the M1450 luminosity function to the hard X-ray 2-10 keV luminosity function using the relation between the UV and X-ray luminosity of quasars and its scatter, the number density of UV-selected quasars matches well with that of the X-ray-selected active galactic nuclei (AGNs) above the knee of the luminosity function. Below the knee, the UV-selected quasars show a deficiency compared to the hard X-ray luminosity function. The deficiency can be explained by the lack of obscured AGNs among the UV-selected quasars.