Isoscalar (T=0,J=1) and isovector (T=1,J=0) pairing correlations in the ground state of self-conjugate nuclei are treated in terms of alpha-like quartets built by two protons and two neutrons coupled to total isospin T=0 and total angular momentum J=0. Quartets are constructed dynamically via an iterative variational procedure and the ground state is represented as a product of such quartets. It is shown that the quartet formalism describes accurately the ground state energies of realistic isovector plus isoscalar pairing Hamiltonians in nuclei with valence particles outside the 16O, 40Ca and 100Sn cores. Within the quartet formalism we analyse the competition between isovector and isoscalar pairing correlations and find that for nuclei with the valence nucleons above the cores 40Ca and 100Sn the isovector correlations account for the largest fraction of the total pairing correlations. This is not the case for sd-shell nuclei for which isoscalar correlations prevail. Contrary to many mean-field studies, isovector and isoscalar pairing correlations mix significantly in the quartet approach.