One thing you could do is have a velocity associated with your rectangle. When you press the up key, you could change the velocity's y-value to a negative value (moving up). Then, you can increase the velocity's y-value each frame (to simulate gravity). In code:
// Set up code
//...
// Relevant code
sf::Vector2f velocity(0.f, 0.f); // Positive x = move right, negative y = move up (relative to screen)
sf::Clock timer;
while (someCondition) // Game loop
{
float timePassed = timer.getElapsedTime().asSeconds();
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) // On key press, change velocity
{
velocity = sf::Vector2f(velocity.x, -100.f);
}
velocity.y += 9.8f * timePassed;
rect.move(velocity * timePassed);
// Do whatever else you need to do
// ...
}
Hopefully this is enough to at least get you started.