The conservative Popular Party made significant gains but may need far right’s help to form a coalition and govern some regions.