The time you're describing represents a very tricky point in history. Here are some things you need to understand:
The United States dominated the Japanese in aerial and naval combat. Shortly after Pearl Harbor pretty much every major Japanese ship was systematically hunted down and sunk. The US were taking losses clearing individual islands, but Japan no longer posed a serious threat to them.
Furthermore, the conflict in Europe was pretty much wrapped up, and this brought the issue of how to handle the Russians into the forefront. Stalin and the West were allies out of necessity, not because there was any love lost between them. Communism was seen to be akin to a dangerous and wildly contagious disease, and every country was jailing communists - even simply suspected ones - like there was no tomorrow. Russia was sponsoring communist movements all over the world (look at Germany pre-WW2, and their communist rebellions).
The US was very much aware that the next conflict may well be fought against their former allies, and very soon at that.
Desire To Use Nukes
So while a very complicated "victory" is being declared in Europe, the US is itching to test their brand new toys in a real-world situation. They could have ended the war any number of other ways - dropping nukes (especially 2 of them) was mainly due to their desire to send a message to the world (Russia in particular), and to see what would happen to the cities, and the surviving population. The Japanese were simply a convenient target, as the conflict in Europe had already wrapped up.
Japanese Political Situation
Even though the Emperor is the official leader of the country, the truth is that the political and military elite were the ones truly running the show. And those guys were not ready to surrender - they had too much to lose. You may be aware that knowing the Emperor was about to take the reins into his own hands and order the country to surrender they tried to storm his compound and kill/capture him. It didn't work out, but it was a close thing.
So you see, there are quite a few reasons why the US wanted to make an example of the Japanese - and simply winning the war against them was not quite the main reason. Additionally, the Japanese public, military high command, and Emperor have to become convinced that fighting you is a losing proposition in order for a surrender to happen.
Your time traveler is going to have to be pretty persuasive to accomplish all that without knocking some heads together. Let's get down to business.
Shock & Awe
You need to make a terrifying example, such that the entire world will know how devastating the Atom Bomb is, not just some Japanese higher ups - that's why bombing a major city is such an attractive proposition. How do you achieve that effect while not killing hundreds of thousands of innocents?
I have two suggestions, which may both have to be implemented:
1. Nuke an island
Approach a heavily defended Japanese held island. You know that high ranking officers are commanding the troops. Some Japanese ships are somewhere off shore, waiting to engage American ships which they expect will soon deploy marines onto the beach. Now you set the stage for maximum effect.
Instead of assaulting their defenses, the US Navy stops quite far out (they're protected by their carrier squadrons and can engage at their leisure). A message is sent in the clear, and in most importantly, in Japanese:
Tomorrow, at 10:00 AM we will bomb this island with a terrifying weapon that you have never seen before. Everyone on the island will die. You have until then to surrender unconditionally, or we will destroy you.
Of course those officers scoff at you. The Americans must think were stupid! They even contact HQ to tell them about the funny Americans. Right.
Next morning - at 10:00 AM on the dot - a high-altitude bomber drops a nuclear bomb on said island. The surviving Japanese sailors - who will probably soon die of radiation poisoning - aren't laughing anymore.
The Japanese military high command are shocked beyond belief, and the Emperor definitely hears about this.
2. Something a little closer to home
Now the Japanese are apprehensive - the US just demonstrated overwhelming firepower, which can clearly be deployed from their carrier groups, and can wipe out an entire island, never mind a naval squadron, or a city.
The US demands that Japan surrenders, but let's say those old goats in power are not quite ready to do so. The Emperor is willing to talk things out of course, but the military high command is still pulling the strings, and they're obstinate bastards.
So now you have to up the stakes: US planes drop a nuke not on Hiroshima, or Nagasaki, but at sea, just a few miles off of the Japanese coast, and hopefully quite close to some major military installation / port.
The blast is enormous: the ocean boils, Japanese planes drop out of the sky like flies, ships roll over and are swallowed by the waves. Immediately afterward the Americans transmit a radio message in the clear:
"We drop the next one on your capital. There's no where you can hide. Surrender immediately."
Faced with such a disparity of power the Japanese will probably surrender, and furthermore, the US will have showcased their terrifying weapon to the world. The only ones not satisfied would be the "curious" few who wanted to see what killing a few hundred thousand civilians looks like.
Regarding Nuclear Brinkmanship
The nature of humanity is to be in conflict. The only reason we have stopped fighting among ourselves in the West is because it has become too unprofitable to do so. Up until the fall of the Soviet Union however, war among European powers was, to some, a certainty.
Every time a nation has invented a new weapon, strategy, or tactic, it's been held over everyone else's head, usually after first giving everyone involved a front row demonstration of their capabilities.
You can't stop the world from discovering nuclear fission. And once they do, you can't stop them weaponizing it because that's what we do. We exceed at killing one another.
Once a nation has nukes it will demonstrate it's awesome might to everyone else as a warning (see the US's behavior), and then once they do their opposition will sure as hell try to match them.
We are only lucky that the threat of mutually assured destruction actually kept the Soviet Union and the USA from turning this planet into a radioactive ash heap.
Again, there are two possibilities to preventing nuclear brinkmanship:
1. Saner mind prevail
You have a slim chance of using your knowledge from the future to explain to all parties involved just how deadly nukes are - what scientists decades later figured out about radiation poisoning, and the potential to literally end the world. Maybe by sitting them down and talking it out the world could come to some kind of agreement
2. Preemptive attack
You know how dangerous the Soviets became. You know the suffering they (and Stalin in particular) brought upon not only their own population, but on the Eastern block.
If you don't you should research the 60 or so million Russians that Stalin killed, the planned starvation in the Ukraine which killed another 20 - 30 million people, the pogroms in Moldova, and other atrocities many of which are still denied by the Russians.
Tell Roosevelt. Encourage him to drop a nuke on Moscow A.S.A.P. Don't let the Russians recover. Don't let them build up their strength. Simply kill that bastard and all the high ranking officials in one fell swoop. With the cancer cut out of the heart of the country the Russians may actually have a chance to build a sane country for themselves, and become valuable allies instead of incredibly dangerous enemies.
Note: this may seem counter intuitive, but I think you underestimate just how much the average Russian would have loved to see Stalin gone. Many people saw the invading German army as liberators. With some well planned propaganda most Russians would actually be quite grateful, even if it costs them Moscow. Not quite bloodless, but in my opinion this is the only way to stop the escalation of nuclear threats.