Theresa May is to travel to Brussels on Wednesday evening to finalise the Brexit deal in a meeting with the European commission president, Jean-Claude Juncker.

With talk of a backbench coup against the prime minister fizzling out, No 10 said the prime minister would head for discussions with Juncker “as part of the ongoing negotiations over the future framework”.

Downing Street and the commission have a deal in principle on the withdrawal agreement concerning citizens’ rights, the £39bn divorce bill and the Irish border problem. Negotiations continue over a separate document about the future relationship.

May’s trip comes as the recent pressure on her position slightly eases, with speculation about an imminent leadership challenge fading as Brexiter rebels failed to amass the 48 letters of no confidence from Conservative MPs needed to trigger a challenge.

She does, however, face a parallel problem after the Democratic Unionist party, which keeps her in office, breached its confidence and supply deal with the Tories by failing to back the government on a series of budget votes on Monday night.

The full text of a political declaration on future EU-UK relations was meant to be published on Tuesday, but the timing is now up in the air. The commission’s chief spokesman declined to say whether the document would appear before or after May’s meeting with Juncker.

“The aim of the meeting is to prepare Sunday’s European council article 50 format [EU 27 leaders] and to ensure that we are in a position again, I repeat, to endorse the draft withdrawal agreement and approve the political declaration of the framework of the future relationship,” he said. “This is not a dinner, it is afternoon tea.”

The EU’s chief Brexit negotiator, Michel Barnier, told MEPs in private that the political declaration would be circulated shortly to a restricted group and offered some hope to May that some of the demands from member states for the political declaration had been resisted.

Asked about the call for the UK to “dynamically align” on environmental, social and labour regulations, Barnier said the EU had to be realistic and could not seek from the UK the same standards outside the bloc as inside it, sources said.

He said he was also mindful to ensure any ambitious language in the document did not allow the Chequers proposals to come back in through the back window, with them having been widely rejected as an attempt at “a la carte membership of the single market”.

Earlier, the Spanish foreign minister, Josep Borrell, and the Spanish prime minister, Pedro Sánchez, warned their country could withhold its support for the entire package unless there was an explicit statement that a future trade deal with the UK would only cover Gibraltar if it received Madrid’s consent.

“In the past 72 hours none of the documents have clarified something which is fundamental for us,” Sánchez said on Tuesday morning. “Gibraltar is not part of the UK … As it stands, the [Spanish] government will vote against the Brexit agreement.”

Borrell echoed his prime minister, saying: “Mrs May said that she will not agree with the withdrawal treaty ... without knowing the content of the political declaration about the future relationship.

“She has said she will not agree with one thing unless I know and agree with the other. Me too. I want to see both things.”

Borrell said Barnier was “trying to write a paper that fits everything together and makes [everybody] happy”.

He added: “We have always been working with one idea, an idea approved several times by the European council. On the future relations, it will not include Gibraltar. Gibraltar is something apart ... Spain has to agree … we want it to be clear one way or another.

“I don’t mind about the instrument but I want it to be clear the future will be negotiated about Gibraltar with the agreement of Spain.”

Borrell said the withdrawal agreement would still go through without Spain’s support, as it did not require unanimity.

He added, however, that the Brexit process had laid bare the fragility of the UK, and warned he could foresee Scotland becoming independent and joining the EU.

“Why not?”, Borrell told Politico in an interview on Tuesday morning. “If they leave Britain within the accordance of the internal regulations. If Westminster agrees, we are not going to be more Papist than the pope. If Westminster agrees, why would we be against it?”

The commission’s spokesman declined to comment on how it would handle Spain’s objections to the withdrawal agreement.

Despite the recent crisis in Catalonia prompted by the independence movement, Borrell said: “I am very much [more] worried about the unity of the United Kingdom than the unity of Spain. I think the United Kingdom will split apart before Spain.”

He warned against a second Brexit referendum, however, as proposed by his prime minister last week.

“I don’t like second referendums. In Europe, we have a record of people voting, voting something that was not what the authorities liked and then being convinced to vote again,” Borrell said.

“It was the case with the Irish at least twice and the Danish also. It is also something that doesn’t look very democratic.”