Heterocyclylpyri(mi)dinylpyrazole of the formula (I), in which R1 to R5, X1, U, Q, W, a, b and n have the meanings given in the description, and agrochemically active salts, to their use and to methods and compositions for controlling phytopathogenic harmful fungi in and/or on plants or in and/or on seed of plants and for reducing mycotoxins in plants and parts of the plants, to processes for preparing such compounds and compositions and treated seed and also to their use for controlling phytopathogenic harmful fungi in agriculture, horticulture, forestry, in animal husbandry, in the protection of materials, in the domestic and hygiene field and for the reduction of mycotoxins in plants and parts of the plants.